// @ts-ignore
/* eslint-disable */
import { request } from '@umijs/max';

/** 添加数据库 POST /database/addDatabase */
export async function addDatabaseUsingPost(
  body: dataFactory.AddDatabaseDTO,
  options?: { [key: string]: any },
) {
  return request<dataFactory.R>('/database/addDatabase', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 修改数据库状态 PUT /database/databaseRelease */
export async function databaseReleaseUsingPut(
  body: dataFactory.ChangeDatabaseStatusDTO,
  options?: { [key: string]: any },
) {
  return request<dataFactory.R>('/database/databaseRelease', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 删除数据库 DELETE /database/deleteDatabase/${param0} */
export async function deleteDatabaseUsingDelete(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: dataFactory.deleteDatabaseUsingDELETEParams,
  options?: { [key: string]: any },
) {
  const { databaseId: param0, ...queryParams } = params;
  return request<dataFactory.R>(`/database/deleteDatabase/${param0}`, {
    method: 'DELETE',
    params: { ...queryParams },
    ...(options || {}),
  });
}

/** 获取数据库类型 GET /database/getDatabaseCategory */
export async function getDatabaseCategoryUsingGet(options?: {
  [key: string]: any;
}) {
  return request<dataFactory.R>('/database/getDatabaseCategory', {
    method: 'GET',
    ...(options || {}),
  });
}

/** 数据库信息 POST /database/getDatabaseList */
export async function getDatabaseListUsingPost(
  body: dataFactory.QueryDatabaseDTO,
  options?: { [key: string]: any },
) {
  return request<dataFactory.R>('/database/getDatabaseList', {
    method: 'POST',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}

/** 修改数据库 PUT /database/updateDatabase */
export async function updateDatabaseUsingPut(
  body: dataFactory.UpdateDatabaseDTO,
  options?: { [key: string]: any },
) {
  return request<dataFactory.R>('/database/updateDatabase', {
    method: 'PUT',
    headers: {
      'Content-Type': 'application/json',
    },
    data: body,
    ...(options || {}),
  });
}
